package com.ocm.tourism.core.domain;

import com.ocm.tourism.core.exception.TourismRuntimeException;


public enum BusinessType {
    HOTEL, RESTAURANT, COFFEE, FOODSTALL, TOURISTAGENCY;

    public static BusinessType getBusinessType(String name){
       if ("HOTEL".equalsIgnoreCase(name)){
          return BusinessType.HOTEL;
       }else if ("RESTAURANT".equalsIgnoreCase(name)){
          return BusinessType.RESTAURANT;
       }if ("COFFEE".equalsIgnoreCase(name)){
          return BusinessType.COFFEE;
       }if ("FOODSTALL".equalsIgnoreCase(name)){
          return BusinessType.FOODSTALL;
       }if ("TOURISTAGENCY".equalsIgnoreCase(name)){
          return BusinessType.TOURISTAGENCY;
       } 
       throw new TourismRuntimeException("error " + BusinessType.class.getName() + ": can not get business type");
    }
}
